//
//  BrandDetailCell.m
//  一键车讯
//
//  Created by 江玉元 on 14/10/29.
//  Copyright (c) 2014年 lanou.3g.com. All rights reserved.
//

#import "BrandDetailCell.h"
#import "BrandDetail.h"
#import "UIImageView+WebCache.h"
@implementation BrandDetailCell

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        // Initialization code
        self.brandImage = [[UIImageView alloc] init];
        [self.contentView addSubview:self.brandImage];
        [_brandImage release];
        
        self.nameLabel = [[UILabel alloc] init];
        [self.contentView addSubview:self.nameLabel];
        [_nameLabel release];
        
        self.priceLabel = [[UILabel alloc] init];
        [self.contentView addSubview:self.priceLabel];
        [_priceLabel release];
    }
    return self;
}

- (void)layoutSubviews
{
    [super layoutSubviews];
    [self.brandImage setImageWithURL:[NSURL URLWithString:self.brandDetail.brandImage]];
    self.nameLabel.text = self.brandDetail.name;
    self.priceLabel.text = self.brandDetail.price;
    
    self.brandImage.frame = CGRectMake(20, 10, 90, 60);
    self.nameLabel.frame = CGRectMake(120, 15, 120, 20);
    self.nameLabel.font = [UIFont systemFontOfSize:14];
    self.priceLabel.frame = CGRectMake(120, 50, 150, 20);
    self.priceLabel.font = [UIFont systemFontOfSize:12];
    [self.priceLabel setTextColor:[UIColor redColor]];
}

- (void)dealloc
{
    [_brandImage release];
    [_nameLabel release];
    [_priceLabel release];
    [super dealloc];
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
